package com.clementheliou.cheliou.dal.dao.comment;

import java.util.List;

import com.clementheliou.cheliou.dal.dao.generic.GenericDAO;
import com.clementheliou.cheliou.dal.model.comment.Comment;

/**
 * Interface of the data access object dedicated to the {@link Comment}
 * instances.
 * 
 * @author Clément HELIOU (clement.heliou@gmail.com)
 * @see {@link Comment};
 * @see {@link GenericDAO}.
 * @since 1.0
 */
public interface CommentDAO extends GenericDAO<Comment> {

	/**
	 * Gets the number of comments related to the given photo.
	 * 
	 * @author Clément HELIOU (clement.heliou@gmail.com)
	 * @param photoId the given photo identifier.
	 * @return the resulting number of comments.
	 * @since 1.0
	 */
	Integer countCommentsOfPhoto(Integer photoId);

	/**
	 * Get the comments related to the given photo from the first index with the
	 * page size. The list is ordering from the newer comments to the olders.
	 * 
	 * @author Clément HELIOU (clement.heliou@gmail.com)
	 * @param photoId the given photo identifier.
	 * @param first the first result's index.
	 * @param pageSize the expected number of results.
	 * @return the resulting comments list.
	 * @since 1.0
	 */
	List<Comment> getCommentsOfPhoto(Integer photoId, int first, int pageSize);
}
